package com.wen.order.api;

import com.wen.commonutils.ordervo.OrderCourseInfoVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @Author：Win
 * @Date: 2021/6/19 18:46
 * @Description:
 */
@Component
@FeignClient("service-edu")
public interface EduApi {
    /**
     * 根据课程id查询课程信息(不含课程大纲和小节)，用于生成订单信息
     *
     * @param courseId 课程id
     * @return result of operation
     */
    @GetMapping("/edu/service/front/course/getOrderCourseInfo/{courseId}")
    OrderCourseInfoVO getOrderCourseInfo(@PathVariable("courseId") String courseId);

    /**
     * 根据课程id更新课程信息,主要是用于课程购买成功后,修改课程的购买数
     *
     * @param courseId 课程id
     * @return true(success) or false(failed)
     */
    @GetMapping("/edu/service/front/course/updateCourseInfo/{courseId}")
    boolean updateCourseInfo(@PathVariable("courseId") String courseId);
}
